﻿using System.Collections.Generic;
using Aquarinum.Base.Infrastructure.WebSocket.Interface;
using Aquarinum.WebSocekt.Core.Entitys;

namespace Aquarinum.Base.Infrastructure.WebSocket.InterfaceImp
{
    public class DefaultClientInfosProvider : IClientInfosProvider
    {
        // ReSharper disable once InconsistentNaming
        private const string WEBSOCKET_CLIENT = "WEBSOCKET_CLIENT";


        //private readonly ICachingProvider<ClientEntity> _cachingProvider;

        public IList<string> GetGroupsByClientId(string clientid)
        {
            //var client = _cachingProvider.Get($"{WEBSOCKET_CLIENT}_{clientid}");
            //return client.Groups;
            return new List<string>();
        }

        public IList<ClientEntity> GetClients()
        {
            //var clients = _cachingProvider.GetByPrefix(WEBSOCKET_CLIENT);
            //return clients.Select(x => x.Value.Value).ToList();
            return new List<ClientEntity>();
        }

        IList<ClientEntity> IClientInfosProvider.GetClientsByGroupId(string groupId)
        {
            //var clients = _cachingProvider.GetByPrefix(WEBSOCKET_CLIENT);
            //return (from client in clients
            //    where client.Value.HasValue && client.Value.Value.Groups.Any(x => x == groupId)
            //    select client.Value.Value).ToList();
            return new List<ClientEntity>();
        }
    }
}